package com.frame.controller;

import com.frame.base.BaseController;
import com.frame.common.BaseWrapper;
import com.frame.common.annotation.NeedAuth;
import com.frame.common.model.ReqUserId;
import com.frame.model.user.req.ReqRefreshTokenVo;
import com.frame.model.user.res.ResRefreshTokenVo;
import com.frame.service.common.UserCommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @author Flying
 * @Description
 * @date 12:33 2018-08-24
 **/
@RestController
@Api(value = "公共接口", description = "公共接口")
public class UserCommonController extends BaseController {

    @Autowired
    private UserCommonService userCommonService;

    /**
     * 用户刷新token
     */
    @ApiOperation(value = "用户刷新token")
    @RequestMapping(value = "/auth2/refreshToken", method = RequestMethod.POST)
    @NeedAuth
    public BaseWrapper<ResRefreshTokenVo> refreshToken(@Valid  ReqRefreshTokenVo reqRefreshTokenVo){

        ResRefreshTokenVo result = userCommonService.refreshToken(reqRefreshTokenVo);
        return new  BaseWrapper<>(result);
    }








}
